package com.lazy.mongodemo.query;

import org.bson.conversions.Bson;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.mongodb.BasicDBObject;

public class QueryUtil {
    private static final Logger logger = LoggerFactory.getLogger(QueryUtil.class);
    
    public static Bson getProjectBson() {
        BasicDBObject project =new BasicDBObject();
        project.append("hostno", 1);
        project.append("posTime", 1);
        project.append("loc", 1);

        // logger.info("project={}", project);
        return project;
    }
    
    /**
     * 获取projection的Bson
     * @return
     */
    public static Bson getProjectBsonPos() {
        BasicDBObject project =new BasicDBObject();
        project.append("hostno", 1);
        project.append("posTime", 1);
        project.append("posLang", 1);
        project.append("posLat", 1);

        // logger.info("project={}", project);
        return project;
    }
}
